<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:replace="admin">
<div th:fragment="content">
    <ul class="nav nav-tabs" id="myTab" role="tablist">
        <li class="nav-item" role="presentation">
            <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">所有班级</a>
        </li>
        <li class="nav-item" role="presentation">
            <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">添加班级</a>
        </li>
    </ul>
    <div class="tab-content" id="myTabContent" style="margin-top: 30px">
        <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
            <table class="table ">
                <thead>
                <tr class="table-danger">
                    <th>序号</th>
                    <th>专业</th>
                    <th>年级</th>
                    <th>班主任</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="class,it:${classlist}" class="table-primary">
                    <td th:text="${it.count}">John</td>
                    <td th:text="${class.getName()}">John</td>
                    <td th:text="${class.getGrade()}">Doe</td>
                    <td th:text="${class.getTeacher().getName()}"></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
            <div class="card" style="width: 600px;margin: 0 auto">
                <div class="card-body">
                    <h3>注册班级</h3>
                    <form action="/addClass" method="post">
                        <input type="text" class="form-control" name="name" placeholder="请输入新专业">
                        <br>
                        <button type="submit" class="btn btn-primary">提交</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</html>